#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QToolBar>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //创建工具栏
    QToolBar* toolbar = new QToolBar(this);
    this->addToolBar(toolbar);

    QAction* action1 = new QAction("打开");
    QAction* action2 = new QAction("保存");
    action1->setToolTip("aa");
    toolbar->addAction(action1);
    toolbar->addAction(action2);

    toolbar->setAllowedAreas(Qt::AllToolBarAreas);

    qDebug() << toolbar->allowedAreas();
}

MainWindow::~MainWindow()
{
    delete ui;
}

